// 全局的getters, 方便获取
// 经常在项目中会使用全局getters映射模块内的数据, 方便获取
const getters = {
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  token: state => state.user.token,
  name: state => state.user.userInfo.username,
  staffPhoto: state => state.user.userInfo.staffPhoto,
  routes: state => state.permission.routes,
  roles: state => state.user.userInfo.roles
  // token(state) {
  //   // 全局state
  //   return state.user.token
  // }
}
export default getters

// this.$store.state.user.token
// this.$store.getters.token

// {
//   getters: {
//     total(state) {
//       return state.xxx.xx
//     }

//     total: function(state) {
//       return state.xxx.xx
//     }

//     total: (state) => {
//       return state.xx.xxx
//     }

//     total: state => state.xx.xxx
//   }

// }
